
#ifndef _MEGABRITE_H
#define _MEGABRITE_H
#ifndef MAX_CHANNELS
  #define MAX_CHANNELS 16
#endif

class channel
{
  public:
    channel();
    channel(int pID);
    int getSmoothTime();
    int* getRGB();
    int getRed();
    int getGreen();
    int getBlue();
    int* getTargetRBG();
    int getTargetRed();
    int getTargetGreen();
    int getTargetBlue();
    int getSmoothTimeoutFlag();
    int getMode();
    void setMode(int pMode);
    void setRGB(int pRGB[3]);
    void setRGB(int pRed, int pGreen, int pBlue);
    void setRed(int pRed);
    void setGreen(int pGreen);
    void setBlue(int pBlue);
    void setSmoothTime(int pSmoothTime);
    void setChannelID(int pID);
    int* step();
	
  protected:
  
  private:
    int _smoothTime;
    int _channelID;
    int _targetRGB[3];
    int _currentRGB[3];
    int _startRGB[3];
    int _smoothTimeoutFlag;
    int _modeFlag;
    unsigned long _startTime;
    void reset();
};

class megaBrite
{
  public:
    megaBrite();
    megaBrite(int pStations);
    int getChannels();
    void setChannels(int pChannels);
    void setSmoothTime(int pSmoothTime);
    void setMode(int pMode);
    void setRGB(int pRGB[3]);
    void setRGB(int pRed, int pGreen, int pBlue);
    void setRed(int pRed);
    void setGreen(int pGreen);
    void setBlue(int pBlue);
    void update();
    channel channels[MAX_CHANNELS];

  private:
    void SB_SendPacket();
    void latchData();
    int _nChannels;
    int _SB_CommandMode;
    int _SB_RedCommand;
    int _SB_GreenCommand;
    int _SB_BlueCommand;
};

#endif

